package chapter5.No5_1_定时器Timer的使用.demo11;

import java.util.Date;
import java.util.Timer;

/**
 * timer.schedule(m1, 2000, 4000); 当前时间2s后开始，每4s循环执行
 */
public class Main {
    public static void main(String[] args) {
        MyTask m1 = new MyTask();
        System.out.println(new Date());

        Timer timer = new Timer();
        timer.scheduleAtFixedRate(m1, new Date(), 4000);

    }
}
